package com.zyh.day02

object StudentTest {
  def main(args: Array[String]): Unit = {
    val s1 = new Std()
    s1.setName("aaa")
    s1.setAge(18)
    println(s1.getName)
    println(s1.getAge)
    s1.m()
    s1.n()
  }
}
class Stu{
  private var name:String = _
  private var age:Int = _

  def getName: String = name
  def getAge: Int = age
  def setName(name:String) = this.name=name
  def setAge(age:Int) = this.age=age

  def m(): Unit ={
    println("Stu m()")
  }
  def n(): Unit ={
    println("Stu n()")
  }
}
class Std extends Stu {
  override def m(): Unit = {
    println("Std m()")
  }
}